﻿#ifndef __SS_SIMPLE_HTTP_H__
#define __SS_SIMPLE_HTTP_H__
#include "ssNetBase.h"
#include "../container/ssBuffer.h"

namespace StarSeeker
{

class ssSimpleHttp
{
public:
	ssSimpleHttp(u32 bufsz);
	//进行一次get请求
	bool QueryHtml(const char* ip, unsigned short port, const char* path);
	//结果缓存地址
	const char* GetHtml() {return m_html;}
	//结果缓存长度
	u32 GetHtmlSize() {return m_htmlLen;}
	//打印结果
	void Print();
	//将结果保存到文件
	bool Save2File(const char* path);
private:
	//分析Html
	bool ExtractHtml();


	ssBuffer	m_buf;
	char*		m_html;
	u32			m_htmlLen;
};

}
#endif
